import axios from '../http'

const api = '/api/goods/search';

const error = (e) => {
  return () => console.error(e);
};

export default function listGoods(params, cb, fcb = error('listGoods')) {
  axios.get(api, {params}).then(d => cb(d.data.goods)).catch(d => fcb(d))
}